package com.zzh.classloader;

import java.net.URL;
import java.net.URLClassLoader;

/**
 * @author 张占恒.
 * @date 2020/8/6.
 * @time 14:13.
 *
 * 查看类加载器加载的路径
 */
public class AppClassLoaderDemo {
    public static void main(String[] args) {
        String[] urls = System.getProperty("java.class.path").split(":");

        for (String url : urls) {
            System.out.println(url);
        }
        System.out.println("================================");
        URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
        URL[] urls1 = classLoader.getURLs();
        for (URL url : urls1) {
            System.out.println(url);
        }
    }
}
